package com.auroramanito.uaa.repository;

import com.auroramanito.uaa.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

public interface UserRepo extends JpaRepository<User,Long> {
    Optional<User> findOptionalByUsername(String username);

    /**
     *  根据永不电子邮箱地址查找用户
     * @param email 邮箱
     * @return 可能为空用户
     */
    Optional<User> findOptionalByEmail(String email);

    long countByUsername(String username);

    long countByEmail(String email);

    long countByMobile(String mobile);

}
